package com.jinkaimen.goodcash.service;

import android.app.IntentService;
import android.content.Intent;

import com.ht.baselibs.bean.BaseGetBean;
import com.ht.baselibs.utils.LogUtils;
import com.ht.baselibs.utils.SharedPreferencesUtils;
import com.jinkaimen.goodcash.manager.ApiManager;

import java.io.IOException;

import retrofit2.Call;
import retrofit2.Response;

public class UploadClientIdSevice extends IntentService {

    public UploadClientIdSevice() {
        super("com.ht.baselibs.services.DownloadApkSevice");
    }

    @Override
    protected void onHandleIntent(Intent intent) {
        Call<BaseGetBean> uploadClientId = ApiManager.getApi().clientid(
                "HSY001017",
                SharedPreferencesUtils.getString(GetuiService.GETUI_CLIEND_ID, "")
        );

        try {
            Response<BaseGetBean> response = uploadClientId.execute();
            if (response.isSuccessful()){
                LogUtils.error("上传clientId成功"+response.body());
            }else {
                LogUtils.error("上传clientId失败");
            }
        } catch (IOException e) {
            e.printStackTrace();
            LogUtils.error("上传clientId失败"+e.getMessage());
        }
    }
}
